import subprocess

testData = [3, 5, 7, 9, 11]
answerData = []
rightData = [6, 120, 5040, 362880, 39916800]
for _testData in testData:
    p = subprocess.Popen('计算阶乘-接收main函数参数.exe %d' % _testData,
                         shell=True,
                         stdout=subprocess.PIPE)
    out, err = p.communicate()
    for line in out.splitlines():
        print(line)
        answerData.append(int(line.decode("ascii")))

print(answerData)

score = 0
testNumber = len(testData)
for i in range(0, testNumber, 1):
    if answerData[i] == rightData[i]:
        score = score + 100 / testNumber

print(score)